package chapter6.No6_1_立即加载_饿汉模式.demo11_不完整;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Created by Administrator on 2016/11/25.
 */
public enum MyObject {

    newObject;

    private Connection connection;

    private MyObject() {
        System.out.println("调用了构造方法");
        try {
            connection = DriverManager.getConnection("");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public Connection getInstance() {
        return connection;
    }
}
